package com.westos.userauth.web;

import com.westos.userauth.service.IdService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/id")
public class IdController {
    @Autowired
    private IdService idService;

    @PostMapping("/getIdByName")
    public ResponseEntity<String> getIdByName(@RequestParam("name")String name){
        String id = idService.getIdByName(name);
        return new ResponseEntity<>(id, HttpStatus.OK);
    }
}
